home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Applications
/
Audio
/
Patchmix
/
XWindowsSource
/
soundfile.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-28
|
1KB
|
57 lines
static char rcsid[] = "$Header: soundfile.c,v 1.3 91/02/13 09:46:28 mara Exp $";
/* soundfile.c
*
* Written by Mara Helmuth
*
* Description: Sound file class
* for Cmix X graphical interface
*
* $Log: soundfile.c,v $
* Revision 1.3 91/02/13 09:46:28 mara
* panel fixes
*
* Revision 1.2 90/09/07 20:50:28 mara
* stereo
*
* Revision 1.1 90/08/27 17:09:33 mara
* Initial revision
*
*
*/
#include "plus.h"
void soundfile::write()
{
SR = atol(panelitem_get(panel,pi_srate,LXPTEXT_VALUE));
chans = *((int *)(panelitem_get(panel,pi_outchans,LXPENUM_VALUE))) + 1;
char* cmd = new char[50];
sprintf(cmd,"sfcreate -r %ld -c %d -f ./sf/%s",SR,chans,inst.name);
system(cmd);
sprintf(cmd,"Newinst/%s < Newinst/data",inst.name);
system(cmd);
delete cmd;
}
void soundfile::rescale()
{
char* cmd = new char[50];
sprintf(cmd,"cmix/bin/rescale -z ./sf/%s",inst.name);
system(cmd);
delete cmd;
}
void soundfile::play()
{
char* cmd = new char[50];
#ifdef WOOF
sprintf(cmd,"play -i ./sf/%s.short",inst.name);
#else
sprintf(cmd,"play ./sf/%s.short",inst.name);
#endif
system(cmd);
delete cmd;
}